package com.hongyue.job1;

import java.util.Collections;
import java.util.Iterator;
import java.util.TreeSet;

public class Demo {
    public static void main(String[] args) {
        TreeSet<String> st = new TreeSet<>();
        Collections.addAll(st, "刘备", "关羽", "张飞", "黄忠", "马超");
        Iterator<String> it = st.iterator();
        while (it.hasNext()) {
            System.out.println(it.next());
        }
        for (String s : st) {
            System.out.println("s = " + s);
        }
    }
}
